package com.xja.controller;

import com.xja.entity.Comment;
import com.xja.entity.Register;
import com.xja.entity.Room;
import com.xja.entity.pojo.RoomAndBills;
import com.xja.entity.pojo.RoomAndIndent;
import com.xja.service.LwlService;
import com.xja.service.impl.LwlServiceImpl;

import java.util.List;

/**
 * @projectName: HotelManager
 * @package: com.xja.controller
 * @className: LwlController
 * @author: WenLiang0214
 * @description:
 * @date: 2022/5/5 20:02
 */
public class LwlController {
    LwlService lwlService = new LwlServiceImpl();

    //查找房间
    public List<Room> findRoom() {
        List<Room> findRoom = lwlService.findRoom();
        return findRoom;
    }

    //根据价格查询房间
    public List<Room> findRoomByPrice(int price) {
        List<Room> findRoomList = lwlService.findRoomByPrice(price);
        return findRoomList;
    }

    //根据状态查询房间
    public List<Room> findRoomByName(String userName) {
        List<Room> roomByStatus = lwlService.findRoomByName(userName);
        return roomByStatus;
    }

    //退房
    public Integer checkOutById(int roomId) {
        Integer payMoney = lwlService.checkOutById(roomId);
        return payMoney;
    }
    
    //评价
    public Integer findUserIdByName(String userName){
        Integer userId = lwlService.findUserIdByName(userName);
        return userId;
    }
    public List<RoomAndBills> findBillsById(int userId){
        List<RoomAndBills> roomAndBillsList = lwlService.findBillsById(userId);
        return roomAndBillsList;
    }
    public Integer estimate( Comment comment){
        Integer estimate = lwlService.estimate(comment);
        return estimate;
    }
    //根据名称获取房间和定单对象
    public List<RoomAndIndent> fidIndent(String findUserName) {

        return  lwlService.fidIndent(findUserName);
    }
    //插入登记表
    public Integer register(Register register){
       return lwlService.register(register);
    }


}
